
// 基于template/src/views/{{appModules}}/{{pages@DELISTVIEW}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	ListViewActionType,
	ListViewController,
	IListViewAbility,
	IListViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useListViewProps,
	useListViewBasic,
	useListViewControllerParams,
    useListViewAction,
} from '@/hooks/view/use-list-view';
import { model } from "./ibizappextendeditor-list-view-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useListViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useListViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useListViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<ListViewActionType, IListViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<ListViewActionType, IListViewAbility>>
) {
	const params: IListViewControllerParams<
		ListViewActionType,
		IListViewAbility
	> = useListViewControllerParams(model, props, evt);
	return new ListViewController(params);
}